package com.xzx.study.animation;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.xzx.study.R;

public class SetupCompleteActivity extends AppCompatActivity {

    private EditText editText;
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setup_complete);

        editText = findViewById(R.id.shake_et);
        button = findViewById(R.id.shake_bt);
        button.setOnClickListener(v -> {
            if ("".equals(editText.getText().toString())) {
                editText.startAnimation(AnimationUtils.loadAnimation(SetupCompleteActivity.this, R.anim.shake));
            } else {
                Toast.makeText(SetupCompleteActivity.this, "登录", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
